import fetch from 'common/src/utils/fetch';
import baseUrl from './env';
import UTILS from "common/src/utils/utils";
// 查询专家组
function  getListPage (data) {
  return fetch({
      url: baseUrl + "/manage/projectspecialist/specialist/getListPage",
      method: 'post',
      data
  });
}
// 查询所有教师
function  getTeacherListPage (data) {
  return fetch({
      url: baseUrl + "/manage/projectspecialist/teacher/getListPage",
      method: 'post',
      data
  });
}
// 专家组新增
function  postTeacherUpdate (data) {
  return fetch({
      url: baseUrl + "/manage/projectspecialist/specialist/update",
      method: 'post',
      data
  });
}
// 删除专家组
function  postTeacherDelete (data) {
  return fetch({
      url: baseUrl + "/manage/projectspecialist/specialist/delete",
      method: 'post',
      data
  });
}
// 查询年度总预算
function  queryAnnualBudget (data) {
  return fetch({
      url: baseUrl + "/manage/projectannualbudget/budget/getListPage",
      method: 'post',
      data
  });
}
// 设置年度总预算
function  setUpAnnualBudget (data) {
  return fetch({
      url: baseUrl + "/manage/projectannualbudget/budget/add",
      method: 'post',
      data
  });
}
// 更新年度总预算
function  updateAnnualBudget (data) {
  return fetch({
      url: baseUrl + "/manage/projectannualbudget/budget/update",
      method: 'post',
      data
  });
}
// 项目信息统计
function  projectInformaGetList (data) {
  return fetch({
      url: baseUrl + "/manage/statistical/projectInformation/getListPage",
      method: 'post',
      data
  });
}
// 下载步骤1
function downloadGetKey(key) {
  return fetch({
      url: `${baseUrl}/competitionExport/result/${key}`,
      method: 'get'
  });
}
// 下载步骤2
function downloadGetPath(params) {
  return fetch({
      url: baseUrl + '/competitionExport/file?file=' + params.file + '&name=' + params.name,
      method: 'get'
  });
}
// 项目信息统计导出
function  projectInformaExport (data) {
  return fetch({
      url: baseUrl + "/manage/statistical/projectInformation/export",
      method: 'post',
      data
  });
}
// 查询学生获奖信息统计
function queryStudentInformation (data) {
  return fetch({
      url: baseUrl + "/manage/manageprojectawardsinfo/studentAwardsInfoList/get",
      method: 'post',
      data
  })
}
// 学生获奖信息统计表下载
function downloadInformation (data) {
  return fetch({
    url: baseUrl + "/manage/manageprojectawardsinfo/studentAwardsInfoList/export",
    method: 'post',
    data
  })
}
// 查询竞赛获奖信息统计
function queryStatisticsCompetition (data) {
  return fetch({
    url: baseUrl + "/manage/manageprojectawardsinfo/competitionAwardsInfoList/get",
    method: 'post',
    data
  })
}
// 查询竞赛获奖信息统计下载模板
function getImportTemplate (data) {
  return fetch({
    url: baseUrl + "/manage/manageprojectawardsinfo/importTemplate",
    method: 'get',
    responseType: 'blob',
    data
  }).then(res => {
    UTILS.downloadFile(res, '竞赛获奖信息.xlsx', 'application/vnd.ms-excel;charset=utf-8');
  });
}
// 竞赛获奖信息统计表下载
function downloadCompetitionInfo (data) {
  return fetch({
    url: baseUrl + "/manage/manageprojectawardsinfo/competitionAwardsInfoList/export",
    method: 'post',
    data
  })
}
// 新增学生获奖
function awardNewStudents (data) {
  return fetch({
    url: baseUrl + "/manage/manageprojectawardsinfo/batch/add",
    method: 'post',
    data
  })
}
// 查询评分项列表
function  projectListPage (data) {
  return fetch({
      url: baseUrl + "/manage/projectscoreconfig/list/page",
      method: 'post',
      data
  });
}
// 评分项新增
function  projectListPageAdd (data) {
  return fetch({
      url: baseUrl + "/manage/projectscoreconfig/add",
      method: 'post',
      data
  });
}
// 评分项编辑
function  projectListPageEdit (data) {
  return fetch({
      url: baseUrl + "/manage/projectscoreconfig/modify",
      method: 'post',
      data
  });
}
// 评分项删除
function  projectListPageRemoveById (data) {
  return fetch({
      url: baseUrl + "/manage/projectscoreconfig/removeById?id="+data,
      method: 'get'
  });
}
// 评分项按年度查询比例设置
function  projectListPageGet (data) {
  return fetch({
      url: baseUrl + "/manage/projectGradeProportion/get?year="+data,
      method: 'get'
  });
}
// 评分项保存评分比例设置
function  projectListSave (data) {
  return fetch({
      url: baseUrl + "/manage/projectGradeProportion/save",
      method: 'post',
      data
  });
}
// 查询项目类别列表
function  projectcategoryListPage (data) {
  return fetch({
      url: baseUrl + "/manage/projectcategory/list/page",
      method: 'post',
      data
  });
}
// 项目类别删除
function  projectcategoryRemoveById (data) {
  return fetch({
      url: baseUrl + "/manage/projectcategory/removeById?id="+data,
      method: 'get'
  });
}
// 项目类别新增
function  projectcategoryAdd (data) {
  return fetch({
      url: baseUrl + "/manage/projectcategory/add",
      method: 'post',
      data
  });
}
// 项目类别编辑
function  projectcategoryModify (data) {
  return fetch({
      url: baseUrl + "/manage/projectcategory/batch/modify",
      method: 'post',
      data
  });
}
// 学院审批人设置新增
function  projectcApproveAdd (data) {
  return fetch({
      url: baseUrl + "/approve/config/add",
      method: 'post',
      data
  });
}
// 学院审批人设置编辑
function  projectcApproveEdit (data) {
  return fetch({
      url: baseUrl + "/approve/config/edit",
      method: 'post',
      data
  });
}
// 学院审批人设置删除
function  projectcApproveDelete (data) {
  return fetch({
      url: baseUrl + "/approve/config/delete",
      method: 'post',
      data
  });
}
// 学院审批人设置查询
function  projectcApproveGetPage (data) {
  return fetch({
      url: baseUrl + "/approve/config/getPage",
      method: 'post',
      data
  });
}
// 查询竞赛获奖信息统计(新)
function getPageList (data) {
  return fetch({
      url: baseUrl + "/manage/manageprojectawardsinfo/awardInfo/getPageList",
      method: 'post',
      data
  })
}
// 竞赛获奖信息导出(新)
function awardInfoExport(data) {
  return fetch({
      url: baseUrl + "/manage/manageprojectawardsinfo/awardInfo/export",
      method: 'post',
      data,
      responseType: 'blob'
  }).then(res => {
      UTILS.downloadFile(res, '竞赛获奖信息统计.xls', 'application/vnd.ms-excel;charset=utf-8');
  });
}
// 获奖统计查询(新)
function awardInfoStatistics (data) {
  return fetch({
      url: baseUrl + "/manage/manageprojectawardsinfo/awardInfoStatistics/getList",
      method: 'post',
      data
  })
}
// 获奖统计导出(新)
function awardInfoStatisticsExport(data) {
  return fetch({
      url: baseUrl + "/manage/manageprojectawardsinfo/awardInfoStatistics/export",
      method: 'post',
      data,
      responseType: 'blob'
  }).then(res => {
      UTILS.downloadFile(res, '获奖统计.xls', 'application/vnd.ms-excel;charset=utf-8');
  });
}
// 获奖统计查询(新college)
function awardInfoCollege (data) {
  return fetch({
      url: baseUrl + "/manage/manageprojectawardsinfo/college/awardInfoStatistics/getList",
      method: 'post',
      data
  })
}
// 获奖统计导出(新college)
function awardInfoCollegeExport(data) {
  return fetch({
      url: baseUrl + "/manage/manageprojectawardsinfo/college/awardInfoStatistics/export",
      method: 'post',
      data,
      responseType: 'blob'
  }).then(res => {
      UTILS.downloadFile(res, '获奖统计.xls', 'application/vnd.ms-excel;charset=utf-8');
  });
}
// 导出模板(新)
function templateExport (data) {
  return fetch({
      url: baseUrl + "/manage/manageprojectawardsinfo/awardInfo/template/export",
      method: 'post',
      data,
      responseType: 'blob'
  }).then(res => {
      UTILS.downloadFile(res, '下载模板.xls', 'application/vnd.ms-excel;charset=utf-8');
  });
}
// 新增学生获奖(新)
function awardInfoAdd (data) {
  return fetch({
      url: baseUrl + "/manage/manageprojectawardsinfo/batch/add",
      method: 'post',
      data
  });
}
// 提交成果页面查询
function  getProjectResult (data) {
  return fetch({
      url: baseUrl + "/manage/manageprojectresult/byProjectId/get?projectId="+data.id,
      method: 'get'
  });
}
// 保存项目成果
function  projectResultSave (data) {
  return fetch({
      url: baseUrl + "/manage/manageprojectresult/save",
      method: 'post',
      data
  });
}
// 更新项目成果
function  projectResultModify (data) {
  return fetch({
      url: baseUrl + "/manage/manageprojectresult/modify",
      method: 'post',
      data
  });
}
// 导出成果
function  projectExportResult (data) {
  return fetch({
      url: baseUrl + "/manage/manageprojectresult/export?projectId=" + data.projectId,
      method: 'get',
      data,
      responseType: 'blob'
  }).then(res => {
      UTILS.downloadFile(res, '同济大学学科竞赛总结表（'+ data.name +'）.doc', 'application/msword;charset=utf-8');
  });
}
// 删除
function  delProject (data) {
  return fetch({
      url: baseUrl + "/manage/project/delProject",
      method: 'post',
      data
  });
}
//设置手动添加时间
function  setTimeapi (data) {
  return fetch({
      url: baseUrl + "/manage/manageprojectawardsinfo/addEntryTime",
      method: 'post',
      data
  });
}
//时间详情
function  setTimeDel (data) {
  return fetch({
      url: baseUrl + "/manage/manageprojectawardsinfo/getEntryTime",
      method: 'get',
  });
}
export default {
  getListPage: getListPage,
  getTeacherListPage: getTeacherListPage,
  postTeacherUpdate: postTeacherUpdate,
  postTeacherDelete: postTeacherDelete,
  queryAnnualBudget: queryAnnualBudget,
  setUpAnnualBudget: setUpAnnualBudget,
  updateAnnualBudget: updateAnnualBudget,
  projectInformaGetList: projectInformaGetList,
  projectInformaExport: projectInformaExport,
  downloadGetKey: downloadGetKey,
  downloadGetPath: downloadGetPath,
  projectListPage: projectListPage,
  projectListPageAdd: projectListPageAdd,
  projectListPageRemoveById: projectListPageRemoveById,
  projectListPageEdit: projectListPageEdit,
  projectcategoryListPage: projectcategoryListPage,
  projectcategoryRemoveById: projectcategoryRemoveById,
  projectcategoryAdd: projectcategoryAdd,
  projectcategoryModify: projectcategoryModify,
  projectcApproveAdd: projectcApproveAdd,
  projectcApproveEdit: projectcApproveEdit,
  projectcApproveDelete: projectcApproveDelete,
  projectcApproveGetPage: projectcApproveGetPage,
  queryStudentInformation: queryStudentInformation,
  downloadInformation: downloadInformation,
  queryStatisticsCompetition: queryStatisticsCompetition,
  downloadCompetitionInfo: downloadCompetitionInfo,
  awardNewStudents: awardNewStudents,
  getImportTemplate: getImportTemplate,
  getPageList: getPageList,
  awardInfoStatistics: awardInfoStatistics,
  awardInfoExport: awardInfoExport,
  awardInfoStatisticsExport: awardInfoStatisticsExport,
  templateExport: templateExport,
  awardInfoAdd: awardInfoAdd,
  awardInfoCollege: awardInfoCollege,
  awardInfoCollegeExport: awardInfoCollegeExport,
  getProjectResult: getProjectResult,
  projectResultSave: projectResultSave,
  projectResultModify: projectResultModify,
  projectExportResult: projectExportResult,
  delProject: delProject,
  projectListPageGet: projectListPageGet,
  projectListSave: projectListSave,
  setTimeapi:setTimeapi,
  setTimeDel:setTimeDel
};
